using System.Windows;
﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Calculator2014
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            this.DataContext = new CalculatorViewModel();
        }

        //private void Add(object sender, ExecutedRoutedEventArgs e)
        //{
        //    if (ValuesAreNumbers())
        //        result.Content = number1 + number2;
        //}       

        //private void Sub(object sender, RoutedEventArgs e)
        //{
        //    if (ValuesAreNumbers())
        //        result.Content = number1 - number2;
        //}

        //private void Mul(object sender, RoutedEventArgs e)
        //{
        //    if (ValuesAreNumbers())
        //        result.Content = number1 * number2;
        //}

        //private void Div(object sender, RoutedEventArgs e)
        //{
        //    if (ValuesAreNumbers())
        //        result.Content = number1 / number2;
        //}

        //private bool ValuesAreNumbers()
        //{
        //    if (!Double.TryParse(value1.Text, out number1) || !Double.TryParse(value2.Text, out number2))
        //    {
        //        MessageBox.Show("Wrong values. Only numbers!", "Warning", MessageBoxButton.OK, MessageBoxImage.Exclamation);
        //        result.Content = "Error. Only Numbers!!";
        //        return false;
        //    }
        //    return true;
        //}
    }
}
